<template>
  <h3 @click="changeNum">One:{{ num }}</h3>
  <h3 @click="bus.emit('changenum', 1)">One:{{ num }}</h3>
</template>

<script setup lang="ts">

import {bus} from "../utils";
import {onMounted} from "vue";

defineProps(["num"]);
const changeNum = function(){
  bus.emit("changenum",200);
}
onMounted(function () {
  bus.on("changenum", () => {
    console.log("ONE->changenum");
    // bus.off("changenum");
  })
})
</script>

<style scoped>

</style>